<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>两个盒子旋转</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            perspective: 500px;
        }

        .box:hover{
            transform: rotateY(180deg);
        }

        .box{
            width: 100%;
            height: 1000px;
            transform-style: preserve-3d;
            transition: all 3s;
            position: relative;
        }

        .c1{
            position: absolute;
            left:50%;
            top: 50%;
            background-color: green;
            width: 200px;
            height: 200px;
        }

        .c1:last-child{
            background-color: pink;
            transform: rotateX(60deg);
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="c1"></div>
        <div class="c1"></div>
    </div>

</body>
</html>